﻿@page "/buttonpermission"
@attribute [TabItemOption(Text = "按钮权限", Icon = "fa-fw fa-solid fa-desktop")]
@inject IFreeSql Fsql
@inject IAdminService IAdminService
<EasyAdminTable TItem="ButtonPermission">
    <TableColumns>
        <TableColumn @bind-Field="@context.UserName" Filterable="true">
            <EditTemplate Context="v">
                <Select TValue="string" Items="GetUsers" ShowSearch="true" @bind-Value="v.UserName" DisplayText="用户名"></Select>
            </EditTemplate>
        </TableColumn>
        <TableColumn @bind-Field="@context.MenuUrl" Filterable="true" PlaceHolder="例如:/yourUrl"></TableColumn>
        <TableColumn @bind-Field="@context.Permissions" Text="按钮组">
            <EditTemplate Context="v">
                <div class="col-12">
                    <CheckboxList TValue="string" @bind-Value="v.Permissions" Items="@GetPermissionItems(v.Permissions!)" DisplayText="按钮权限" IsVertical="false"></CheckboxList>
                </div>
            </EditTemplate>
        </TableColumn>
    </TableColumns>
</EasyAdminTable>
